<script>
<!--
var sort_by = '';
var sort_order = 0;
var current_view = '';
var page = 1;

function listReload(page)
{
    $('#indexAjax').html('<div align="center"><div class="loader_admin"></div></div>');
    $('#indexAjax').load('<?php echo url_for('@cms_category_list') ?>?'+$('#filterSearch').serialize(), {
        sort_by:      sort_by,
        sort_order:   sort_order,
        page:         page,
        view:         current_view,
    });
}

-->
</script>
<h1>Danh mục</h1>
<div id="SearchForm" class='backend_form'>
  <form id="filterSearch" action="<?php echo url_for('@cms_category_list') ?>" method="post">
    <table>
      <?php echo $cms_category_form['parent_id']->renderRow();  ?>
	  <?php echo $cms_category_form['alias']->renderRow();  ?>
      <?php echo $cms_category_form['name']->renderRow();  ?>
      <?php echo $cms_category_form['position']->renderRow();  ?>
      <?php echo $cms_category_form['_csrf_token'];  ?>
      <tr>
        <td></td>
        <td>
            <input id="create" type="submit" name="create" value="Create" />
            <?php if (isset($create_success) && $create_success): ?>
                <div><span>Danh mục đã tạo thành công</span></div>
                <script>
                    window.location.href = document.location.href;
                </script>
            <?php elseif (isset($create_success) && $create_success == false): ?>
                <div><span>Danh mục đã tồn tại</span></div>
                <script>
                    window.location.href = document.location.href;
                </script>
            <?php elseif (isset($is_create_action)) :?>
                <div><span>Danh mục không đúng</span></div>
                <script>
                    window.location.href = document.location.href;
                </script>
            <?php endif ?>
        </th>
      </tr>
    </table>
  </form>
</div>
      
<div style='padding-top:10px;'>
<div class="UITable">
  <div id="indexAjax" class='filter_form'>
    <?php include 'categoryListAjax.php' ?>
  </div>
</div>
</div>